package day07;

import java.util.Scanner;
/*
* 机票价格按照淡季，旺季，头等舱，商务舱和经济舱收费
* 输入机票原价，月份和头等舱，商务舱以及经济舱
* 其中旺季（5-10月）头等舱9折，商务舱85折，经济舱8折
* 淡季（11月到来年4月）头等舱7折，商务舱6.5折，经济舱6折
* 最终输出机票价格
* */
public class CalAirPrice {
    public static void main(String[] args) {
        add();
    }
    public static void add(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入月份");
        int m = scanner.nextInt();
        if (m<1||m>12){
            System.out.println("请输入正确的月份");
        }
        if (m>=5&&m<=10){
            System.out.println("请选择舱位"+"\n"+"1.头等舱"+"\n"+"2.商务舱"+"\n"+"3.经济舱");
            int d = scanner.nextInt();
            if (d<1||d>3){
                System.out.println("请输入正确的舱位");
                return;
            }
            System.out.println("请依次输入机票的原价");
            double a = scanner.nextDouble();
            if (d == 1){
                double sum = a*0.9;
                System.out.println("此次价格为"+sum);
            }else if(d == 2){
                double sum = a*0.85;
                System.out.println("此次价格为"+sum);
            }else if (d == 3){
                double sum = a*0.8;
                System.out.println("此次价格为"+sum);
            }
        }else if ((m>=1&&m<=4)||m==11||m==12){
            System.out.println("请选择舱位"+"\n"+"1.头等舱"+"\n"+"2.商务舱"+"\n"+"3.经济舱");
            int d = scanner.nextInt();
            if (d<1||d>3){
                System.out.println("请输入正确的舱位");
                return;
            }
            System.out.println("请依次输入机票的原价");
            double a = scanner.nextDouble();
            if (d == 1){
                double sum = a*0.7;
                System.out.println("此次价格为"+sum);
            }else if(d == 2){
                double sum = a*0.65;
                System.out.println("此次价格为"+sum);
            }else if (d == 3){
                double sum = a*0.6;
                System.out.println("此次价格为"+sum);
            }
        }
    }
}
